﻿using System.Windows.Forms;
using WinFormsMVC;
using System.Drawing.Drawing2D;
using System.Drawing;

namespace SampleApp.Views.Main
{
    public partial class BaseMain : Form
    {
        public BaseMain()
        {
            InitializeComponent();
        }

        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            App.Instance.CallRoute("Program", "Exit");

            base.OnClosing(e);
        }

        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            // var baseRectangle = new Rectangle(0, 0, this.Width, Height - 1);
            var brush = new LinearGradientBrush(this.ClientRectangle, Color.FromArgb(235, 235, 235), Color.FromArgb(154, 163, 171), 90);
            e.Graphics.FillRectangle(brush, this.ClientRectangle);

            base.OnPaint(e);
        }

        protected override void OnResize(System.EventArgs e)
        {
            base.OnResize(e);
            base.Invalidate();
        }
    }
}
